<?php

require_once dirname(__FILE__).'/../lib/ApplicationGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/ApplicationGeneratorHelper.class.php';

/**
 * application actions.
 *
 * @package    wills
 * @subpackage application
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class applicationActions extends autoApplicationActions
{
  public function executeBatchPass(sfWebRequest $request)
  {
    $applications = Doctrine::getTable('Application')
      ->createQuery('a')
      ->whereIn('a.id', $request->getParameter('ids'))
      ->execute();

    foreach ($applications as $application)
    {
      $application->setToPassed();
    }

    $this->getUser()->setFlash('message', '操作成功！');
    $this->redirect('@application');
  }

  public function executeListPass(sfWebRequest $request)
  {
    $this->getRoute()->getObject()->setToPassed();

    $this->getUser()->setFlash('message', '操作成功！');
    $this->redirect('@application');
  }
}
